const Koa = require('koa')
const views = require('koa-views')

// webSocket
require('./websocket')

const app = new Koa()

app.use(views(__dirname + '/views', {extension: 'ejs'}))
app.use(async ctx => {
    await ctx.render('index')
})

app.listen(3000, () => {
    // http 服务器启动成功后执行本回调函数
    console.log('启动成功,端口号3000');
})